package com.example.mapper;

import com.example.entity.PrescriptionItem;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 操作prescription_Item相关数据接口
*/
public interface PrescriptionItemMapper {

    /**
      * 新增
    */
    int insert(PrescriptionItem prescriptionItem);

    /**
      * 删除
    */
    int deleteById(Integer id);

    /**
      * 修改
    */
    int updateById(PrescriptionItem prescriptionItem);

    /**
      * 根据ID查询
    */
    PrescriptionItem selectById(Integer id);

    /**
      * 查询所有
    */
    List<PrescriptionItem> selectAll(PrescriptionItem prescriptionItem);

    @Select("select * from prescription_item where prescription_id = #{ prescriptionId }")
    List<PrescriptionItem> selectByPrescriptionId(Integer prescriptionId);

    @Select("select * from prescription_item where drug_id = #{ id }")
    List<PrescriptionItem> selectByDrugId(Integer id);
}